import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/users/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/users/info',
    method: 'get',
    params: {token}
  })
}

export function userPage(data) {
  return request({
    url: '/users/page',
    method: 'post',
    data
  })
}

export function changUserState(data) {
  return request({
    url: '/users/change/state',
    method: 'post',
    data
  })
}

export function resetPwd(id) {
  return request({
    url: '/users/reset/pwd/' + id,
    method: 'get',
  })
}

export function userOne(id) {
  return request({
    url: '/users/one/' + id,
    method: 'get',
  })
}

export function addOrUpdate(data) {
  return request({
    url: '/users/insert/edit',
    method: "post",
    data
  })
}

export function userBatchDelete(data) {
  return request({
    url: '/users/batch/remove',
    method: "post",
    data
  })
}
